/***************************************************************************
 *   Copyright (C) 2007 by Phillip Aldridge   *
 *   phillip@imi21.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef FTP_H
#define FTP_H
#include "config.h"

#include <qwidget.h>
#include <qftp.h>
#include <qstringlist.h>

/**
	@author Phillip Aldridge <phillip@imi21.com>
   This class will deal with all the ftp uploads of
   files such as the php and web banner to the web server

*/
class FTP: public QWidget{
Q_OBJECT
public:
    FTP(QWidget *parent = 0);

    ~FTP();

   void destroy();
   void uploadFile();
   void downloadFile();
   void removeFile();
   void connectToHost();
   void clearList();
   void addFile( QString );
   void setHost(QString h,QString p);
   void setUser(QString u,QString p);
protected:
   QFtp *ftp;
   QString ftpFile;
   QStringList fileList;
   QString host,port, user, password;
public slots:
   void ftp_commandStarted();
   void ftp_commandFinished(int id, bool error);
   void ftp_done( bool);
   void ftp_stateChanged( int );
   void ftp_listInfo( const QUrlInfo &);
   void ftp_rawCommandReply( int , const QString & );

};

#endif
